package LeetCode;

public class LC_557_ReverseWordsinaStringIII {

    public static void main(String[] args) {

    }

    class Solution {
        public String reverseWords(String s) {
            String[] str = s.split(" ");
            for (int i = 0; i < str.length; i++)
                str[i] = new StringBuilder(str[i]).reverse().toString();
            StringBuilder result = new StringBuilder();
            for (String st : str)
                result.append(st).append(" ");
            return result.toString().trim();
        }
    }

}